package es.cazadoresmadridejos.objs.web;

import java.util.List;

import org.displaytag.pagination.PaginatedList;
import org.displaytag.properties.SortOrderEnum;

public class PaginatedListImpl<T extends Object> implements PaginatedList{

	private List<T> list;
	private Page page;
	private Integer size;
	
	public PaginatedListImpl(List<T> list, Page page,Integer size){
		this.list = list;
		this.page = page;
		this.size = size;
	}
	
	@Override
	public List<T> getList() {
		return list;
	}

	@Override
	public int getPageNumber() {
		return page.getPage();
	}

	@Override
	public int getObjectsPerPage() {
		return page.getLimit();
	}

	@Override
	public int getFullListSize() {
		return this.size;
	}

	@Override
	public String getSortCriterion() {
		return page.getSort();
	}

	@Override
	public SortOrderEnum getSortDirection() {
		return page.getSortOrder();
	}

	@Override
	public String getSearchId() {
		// TODO Auto-generated method stub
		return null;
	}

}
